{% extends 'users/profile-base.html' %}
{% load static %}
{% load tasks_tags %}

{% block title %}
    Внесение изменений
{% endblock title %}

{% block right_frame %}

    <div class="profile-frame__right">

        <div class="task-change-frame-container glass">

            <a class="backBtn" href="{% url 'task:task-detail' task_id %} ">
                <img src="{% static 'icons/back_btn.png' %}" alt="{{ task_id }}"/>
            </a>

            <div class="task-change-frame">
                <form method="post" enctype="multipart/form-data">
                
                    {% csrf_token %}
                    <div class="frameData row hidden">
                        <p>{{ form.is_done }}</p>
                    </div>
                    <div class="frameData row">
                        <label  class="inputArea" for="id_title" class="form-label">Название:</label>
                        {{ form.title }}
                    </div>
                    <div class="frameData row">
                        <label class="inputArea" for="id_description" class="form-label">Описание:</label>
                        {{ form.description }}
                    </div>
                    {% if creation_date|check_date %}
                    <div class="frameData row">
                        <label class="inputArea" for="id_start_img" class="form-label">Изображение 1:</label>
                        {{ form.start_img }}
                    </div>
                    {% endif %}
                    <div class="frameData row">
                        <label class="inputArea" for="id_remind_by_date" class="form-label">Напомнить:</label>
                        <input type="date" name="remind_by_date" id="id_remind_by_date" required="false">
                    </div>
                    {% if done %}
                        <div class="frameData row">
                            <label class="inputArea" for="id_end_img" class="form-label">Изображение 2:</label>
                            {{ form.end_img }}
                        </div>
                        <div class="frameData row">
                            <label class="inputArea" for="id_done_comment" class="form-label">Комментарий:</label>
                            {{ form.done_comment }}
                        </div>
                    {% endif %}
                    
                    <button class="saveBtn" type="submit">Сохранить</button>
                </form>

            </div>
        </div>
    </div>
{% endblock right_frame %}